#! /bin/bash
jar='IChat-0.0.1-SNAPSHOT.jar'
app="/root/ichat/target/${jar}"
git pull
mvn clean compile package -Dmaven.test.skip=true
pid=$(pgrep -f "$jar")
if [ -z $pid ]; then
    echo "${app} is not runing!"
else
    kill $pid
fi
nohup java -jar $app >logs.log 2>&1 &
echo 'finished!'
